package com.shelpe.services.simbasync.model.mongo;

import java.util.Date;

import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.data.mongodb.core.index.Indexed;

import lombok.Data;

@Data
public class Scope{
	@Indexed
	private Date startTime;
	@Indexed
	private Date endTime;
	
	public Scope(){
		
	}
	public Scope(Date startTime, Date endTime) {
		super();
		this.startTime = startTime;
		this.endTime = endTime;
	}
	
	public String toIdentity(){
		return DateFormatUtils.format(this.startTime, "yyyyMMdd") + "-" + DateFormatUtils.format(this.endTime, "yyyyMMdd");
	}
	
}